<%--
 * edit.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>


<form:form action="${requestURI}" modelAttribute="order">

	<acme:textbox code="order.creationMoment" path="creationMoment"
		readonly="true" />
	<acme:textbox code="order.totalPrice" path="totalPrice" readonly="true" />

</form:form>

<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="purchasedItems" requestURI="${requestURI}" id="row">


	<spring:message code="order.purchasedItem.referenceNumber"
		var="referenceNumberHeader" />
	<display:column property="referenceNumber"
		title="${referenceNumberHeader}" sortable="false" />

	<spring:message code="order.purchasedItem.name" var="nameHeader" />
	<display:column property="name" title="${nameHeader}" sortable="false" />

	<spring:message code="order.purchasedItem.units"
		var="purchasedUnitsHeader" />
	<display:column property="purchasedUnits"
		title="${purchasedUnitsHeader}" sortable="false" />



	<spring:message code="order.purchasedItem.price" var="priceHeader" />
	<display:column property="price" title="${priceHeader}"
		sortable="false" />


	<spring:message code="order.purchasedItem.buyerName"
		var="buyerNameHeader" />
	<display:column property="order.buyer.name" title="${buyerNameHeader}"
		sortable="false" />

	<spring:message code="order.purchasedItem.buyerAddress"
		var="buyerAddressHeader" />
	<display:column property="order.buyer.address"
		title="${buyerAddressHeader}" sortable="false" />

	<display:column>
		<a href="purchasedItem/customer/edit.do?purchasedItemId=${row.id}"><spring:message
				code="order.purchasedItem.view" /></a>
	</display:column>
</display:table>

<acme:cancel code="order.goBack" url="${backURI}" />